package com.pureut.equipment.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.pureut.equipment.domain.MaintenancePlan;
import com.pureut.equipment.domain.dto.MaintenancePlanDto;
import com.pureut.equipment.domain.vo.MaintenancePlanVo;
import com.pureut.equipment.domain.vo.RescindVo;
import com.sale.common.mybatis.core.page.PageQuery;
import com.sale.common.mybatis.core.page.TableDataInfo;

import java.text.ParseException;
import java.util.List;

/***
 *
 * Author: 保养计划service
 * Date:2023/04/23 14:18
 * @DESC
 */
public interface MaintenancePlanService extends IService<MaintenancePlan> {

    /**
     * 保养计划列表
     */
    TableDataInfo<MaintenancePlanDto> getList(MaintenancePlanVo maintenancePlanVo, PageQuery pageQuery);

    /**
     * 新增
     */
    boolean add(MaintenancePlanVo maintenancePlanVo) throws Exception;

    /**
     * 删除
     */
    boolean removePlan(Long id);

    /**
     * 修改
     */
    boolean updatePlan(MaintenancePlanVo maintenancePlanVo);

    /**
     * 查看
     */
    MaintenancePlanDto getView(Long id);

    /**
     * 启用
     */
    boolean enable(Long id) throws Exception;

    /**
     * 停用
     */
    boolean stop(Long id);

    /**
     * 解除关联
     */
    boolean rescind(RescindVo rescindVo);

    /**
     * 根据计划开始时间和结束时间定时修改计划状态（定时任务调用）
     */
    boolean updateMaintenanceStatusByTime() throws ParseException;
}
